#ifndef DATAUTIL_H
#define DATAUTIL_H
#include<QString>
#include<QList>
#include<QTableWidget>

class DataUtil{
public:
//    /**
//     * @brief getTableList   //判断是否重复，不重复就插入
//     * @param InsertString   //需要插入的QString
//     * @param LibsTable     //被插入的List
//     * @return
//     */
//    bool getTableList(QString InsertString, QList<QString> *LibsTable);
    /**
     * @brief AddOneRow  //添加一行LineEdit
     * @param table
     * @param Name
     * @param LineEditText
     * @return
     */
    bool AddOneRow(QTableWidget *table,QString Name,QString LineEditText);
    /**
     * @brief AddOneRow //添加一行Combox
     * @param table
     * @param Name
     * @param ComboxItemList
     * @return
     */
    bool AddOneRow(QTableWidget *table,QString Name,QList<QString> *ComboxItemList);

    bool AddEditedRow(QTableWidget *table,QString key,QString value);

    bool Remove(QTableWidget *table);

    bool showListTable(QTableWidget *table,QList<QString> *LibsList);

    bool showListTable(QTableWidget *table,QList<QList<QString> *>  *LibsList);

    bool copySpecialFile(QTableWidget *table,QString toPath);

    bool AddItemToTable(QTableWidget *table, QStringList files_full);
    bool AddItemToTable(QTableWidget *table, QString Foldpath);

    QList<QString> *getAllTableData(QTableWidget *table );
private:
    /**
     * @brief removeListItems //从 AllLibsList中移除SelectedLibs中所有元素
     * @param SelectedLibs
     * @param AllLibsList
     * @return
     */
    bool removeListItems(QList<QString> *SelectedLibs,QList<QString> *AllLibsList);
    /**
     * @brief removeListItems //两列
     * @param SelectedLibs
     * @param AllLibsList
     * @return
     */
    bool removeListItems(QList<QList<QString> *> *SelectedLibs, QList<QList<QString> *> *AllLibsList);
};

#endif // DATAUTIL_H
